package distance;


public class Test3
{
    public Double cal(double x1, double y1, double x2, double y2)
    {
        return (x2 - x1) * (y1 + y2)/2.0;
    }

    public static void main(String[] args)
    {
        Point2d p1 = new Point2d(0, 0);
        Point2d p2 = new Point2d(0, 1);
        Point2d p3 = new Point2d(1, 0);

        Test3 test3 = new Test3();
        double sum = test3.cal(p1.x, p1.y, p2.x, p2.y)
                + test3.cal(p2.x, p2.y, p3.x, p3.y)
                + test3.cal(p1.x,p1.y,p3.x,p3.y);

        System.out.println(sum);
    }
}
